{{extend './layout.htm'}}

{{block 'css'}}
<link href="https://cdn.bootcss.com/highlight.js/9.15.10/styles/default.min.css" rel="stylesheet">
<style>
.layui-tab-content{padding: 10px 0 0;}
.layui-form-label{width: 90px;}
.layui-input-block{margin-left: 120px;}
</style>
{{/block}}

{{block 'main'}}
<form method="post" class="layui-form">
    <div class="layui-tab" lay-filter="demo">
        <ul class="layui-tab-title">
            <li class="layui-this">站点设置</li>
            <li>图片上传</li>
            <li>其他</li>
            <li style="display: none;">自定义</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                {{each list item}}
                {{if item.group == 'web'}}
                <div class="layui-form-item">
                    <label class="layui-form-label">{{item.intro}}</label>
                    <div class="layui-input-block">
                        {{if item.type == 'input'}}
                        <input type="text" name="{{item.kname}}" lay-verify="required" lay-verType="tips" class="layui-input" value="{{item.value}}">
                        {{else}}
                        <textarea name="{{item.kname}}" placeholder="请输入{{item.intro}}" class="layui-textarea">{{item.value}}</textarea>
                        {{/if}}
                    </div>
                </div>
                {{/if}}
                {{/each}}
            </div>
            <div class="layui-tab-item">
                {{each list item}}
                {{if item.group == 'image'}}
                <div class="layui-form-item">
                    <label class="layui-form-label">{{item.intro}}</label>
                    <div class="layui-input-block">
                        {{if item.type == 'input'}}
                        <input type="text" name="{{item.kname}}" lay-verify="required" lay-verType="tips" class="layui-input" value="{{item.value}}">
                        {{else}}
                        <textarea name="{{item.kname}}" placeholder="请输入{{item.intro}}" class="layui-textarea">{{item.value}}</textarea>
                        {{/if}}
                    </div>
                </div>
                {{/if}}
                {{/each}}
            </div>
            <div class="layui-tab-item">
                {{each list item}}
                {{if item.group == 'other'}}
                <div class="layui-form-item">
                    <label class="layui-form-label">{{item.intro}}</label>
                    <div class="layui-input-block">
                        {{if item.type == 'input'}}
                        <input type="text" name="{{item.kname}}" lay-verify="required" lay-verType="tips" class="layui-input" value="{{item.value}}">
                        {{else}}
                        <textarea name="{{item.kname}}" placeholder="请输入{{item.intro}}" class="layui-textarea">{{item.value}}</textarea>
                        {{/if}}
                    </div>
                </div>
                {{/if}}
                {{/each}}
            </div>
            <div class="layui-tab-item">
                {{each list item}}
                {{if item.group == 'self'}}
                <div class="layui-form-item">
                    <label class="layui-form-label">{{item.intro}}</label>
                    <div class="layui-input-block">
                        {{if item.type == 'input'}}
                        <input type="text" name="{{item.kname}}" lay-verify="required" lay-verType="tips" class="layui-input" value="{{item.value}}">
                        {{else}}
                        <textarea name="{{item.kname}}" placeholder="请输入{{item.intro}}" class="layui-textarea">{{item.value}}</textarea>
                        {{/if}}
                    </div>
                </div>
                {{/if}}
                {{/each}}
            </div>
        </div>
    </div>
    <div style="text-align: center;">
        <button class="layui-btn" lay-submit>提交</button>
    </div>
</form>
{{/block}}

{{block 'js'}}
<script>
    layui.use(['form', 'element'], function(){
        var form = layui.form
        ,element = layui.element;
    });
</script>
{{/block}}